//package cz.cvut.kadledav.paa.weight3sat.util;
//
//import cz.cvut.kadledav.paa.knapsack.bo.ComputedInstanceSolution;
//import cz.cvut.kadledav.paa.knapsack.bo.InstanceCategorySolution;
//import cz.cvut.kadledav.paa.weight3sat.bo.Instance;
//import cz.cvut.kadledav.paa.weight3sat.bo.SolutionState;
//
//import java.io.BufferedWriter;
//import java.io.File;
//import java.io.FileWriter;
//import java.io.IOException;
//import java.text.SimpleDateFormat;
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//
///**
// * User: David Kadlecek
// * Date: 8.10.13
// */
//public class FileUtil {
//    private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
//
//    public static void write(String filePrefix, List<InstanceCategorySolution> solutions, Map<String, Object> params) throws IOException {
//
//        File file = new File("output/" + filePrefix + "_" + dateFormat.format(new Date()) + ".csv");
//        file.createNewFile();
//        String[] specialForTaskHeaders = params.keySet().toArray(new String[0]);
//        String[] specialForValues = new String[specialForTaskHeaders.length];
//        for (int i = 0; i < specialForTaskHeaders.length; i++) {
//            String specialForTaskHeader = specialForTaskHeaders[i];
//            Object value = params.get(specialForTaskHeader);
//            specialForValues[i] = value.toString();
//        }
//
//
//    }
//
//
//    public static void write(List<Instance> instances, Map<Instance, SolutionState> worstSolutions, Map<Instance, SolutionState> bestSolutions) {
//        try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file))) {
//            bufferedWriter.write("instanceId,worst,best");
//            bufferedWriter.newLine();
//            for (Instance instance : instances) {
//                SolutionState worst = worstSolutions.get(instance);
//                SolutionState best = bestSolutions.get(instance);
//                bufferedWriter.write(instance.getId()+","+ worst+","+best+","+diffToString(worst, best));
//                bufferedWriter.newLine();
//            }
//        } catch (IOException e) {
//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
//        }
//
//    }
//
////    private static int diffToString(SolutionState worst, SolutionState best) {
////        if (best.isSatisfiable() && !worst.isSatisfiable()) {
////            return "řešení nalezeno x nenalezeno :"
////        }
////        } else if (!isSatisfiable() && other.isSatisfiable()) {
////            return false;
////        } else if (getWeight() > other.getWeight()) {
////            return true;
////    }
//}
